<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<!-- Mirrored from www.zi-han.net/theme/hplus/index.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:20:37 GMT -->
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>后台用户管理</title>
    <meta name="keywords" content="PHP1611后台管理">
    <meta name="description" content="PHP1611后台管理">
    <link rel="shortcut icon" href="/Public/Admin/favicon.ico">
    <link href="/Public/Admin/css/bootstrap.min.css" rel="stylesheet">
    <link href="/Public/Admin/css/font-awesome.min.css" rel="stylesheet">
    <link href="/Public/Admin/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="/Public/Admin/css/animate.css" rel="stylesheet">
    <link href="/Public/Admin/css/style.css" rel="stylesheet">
    <link href="/Public/Admin/js/plugins/layer/skin/layer.css" rel="stylesheet">
    <link href="/Public/Admin/js/plugins/layer/laypage/skin/laypage.css" rel="stylesheet">
    <style>
        #show img{
            border-radius: 50%;
            width: 50px;
            height: 50px;
            vertical-align:middle;
        }
    </style>
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>留言管理</h5>
                    <div class="ibox-tools">
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="row m-b-sm m-t-sm">
                        <form name="admin_list" id="admin_list" action="<?php echo U('index');?>" method="get">
                            <!-- <form name="admin_list" id="admin_list" action="<?php echo U('index');?>" method="get">
                            <div class="col-md-3" style="margin-top: 2px">
                                <div class="input-group">
                                    <input type="text"  id="title" name="title" placeholder="" value="<?php echo ($title); ?>" class="input-sm form-control"> <span class="input-group-btn">
                                            <button type="submit" class="btn btn-sm btn-primary" id="submit"> 搜索</button> </span>
                                </div>
                            </div> -->
                        </form>
                    </div>

                    <table class="table table-bordered">
                        <thead>
                        <tr>
                            <th>ID</th>
                            <th>用户名</th>
                            <th>留言内容</th>
                            <th>留言时间</th>
                            <th>审核状态</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody id="show">
                        <tr>
                            <td colspan="8"  width="500px" height="300px">
                                <div class="sk-spinner sk-spinner-chasing-dots">
                                    <div class="sk-dot1"></div>
                                    <div class="sk-dot2"></div>
                                </div>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                    <div style="text-align:center" id="page1"></div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="/Public/Admin/js/jquery.min.js"></script>
<script src="/Public/Admin/js/bootstrap.min.js"></script>
<script src="/Public/Admin/js/plugins/layer/layer.min.js"></script>
<script src="/Public/Admin/js/plugins/switchery/switchery.min.js"></script>
<script src="/Public/Admin/js/plugins/validate/jquery.validate.min.js"></script>
<script src="/Public/Admin/js/plugins/validate/messages_zh.min.js"></script>
<script src="/Public/Admin/js/plugins/layer/laypage/laypage.js"></script>
<script src="/Public/Admin/js/comment.js"></script>
<script>
    //异步分页（第三种分页方法）
    var page='1',title=''; //初始化
    function demo(curr,title=''){
        $.getJSON("<?php echo U("guestbook/pageList");?>",{
            page:curr || 1,//向服务端传的参数，此处只是演示
            title:title
        },function(res){
            //此处仅仅是为了演示变化的内容
            var demoContent = (new Date().getTime()/Math.random()/1000)|0;
            document.getElementById('show').innerHTML = res.content; //从台获取需要展示的内容，并展示到id为show的里面
            //显示分页
            laypage({
                cont:'page1', //容器。值支持id名，jquery对象，dom对象
                pages:res.pages, //通过后台拿到的总页数
                curr:curr || 1, //当前页
                skin:'#AF00000', //当前页容器的背景颜色
                skip:true, //跳转到第某页的
                jump:function(obj,first){ //此函数用于跳转页面（回调函数）
                    if(!first){ //如果不是第一页的话就跳转
                        page = obj.curr;
                        demo(obj.curr,title);
                    }
                }
            });
        });
    };
    demo();//调用函数
   /* $("#submit").click(function(){ //当搜索提交时，如果搜索内容为空，提示不能为空；
        // 不为空时，调用函数demo（在地址栏里跳转页面要传当前页page的值和搜索的内容title的值）
        title = $("#title").val();
        if(title == ''){
            common.error('搜索内容不能为空！');
            return false;
        }
        demo(page,title);
    });*/


    function changeStatus(id){
        var objectStatus = $('#status'+id);
        $.post(
                "<?php echo U('guestbook/changeStatus');?>",
                {id:id},
                function(data){
                    if(data.status > 0){
                        layer.msg(data.msg, {icon:5, time: 1000});
                    }else{
                        if(data.data == 1){
                            objectStatus.removeClass('label-danger').addClass('label-primary').html('已审核');
                        }else{
                            objectStatus.removeClass('label-primary').addClass('label-danger').html('未审核');
                        }
                    }
                },
                'json');
    }

    function del(id)
    {
        layer.msg('你确定删除吗？',{
            time:0,
            btn:['确定','取消'],
            yes:function(index){
                $.post(
                        "<?php echo U('guestbook/del');?>",
                        {id:id},
                        function(data){
                            if (data.status > 0) {
                                layer.msg(data.msg, {icon:5, time: 1000});
                            }else{
                                layer.msg(data.msg, {icon:6, time: 3000});
                                window.location.href = '/admin/guestbook/index';
                            }
                        }, 'json');
            }
        });
    }
</script>
<!-- Mirrored from www.zi-han.net/theme/hplus/index.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:20:37 GMT -->
</html>